@extends('admin::layouts.master')
@section('content')
    @component('components.tabs',['title'=>'类目管理'])
        @slot('nav')
            <li class="nav-item"><a class="nav-link" href="/article/category">类目列表</a></li>
            <li class="nav-item"><a class="nav-link active" href="/article/category/create">添加类目</a></li>
        @endslot
        @slot('content')
            <div class="card">
                 <div class="card-body">
                    <form action="/article/category" method="post">
                        @csrf
                        <div class="form-group row">
                            <label class="col-12 col-sm-2 col-form-label text-sm-right" for="inputText3">栏目名称</label>
                            <div class="col-12 col-sm-6 col-lg-6">
                                <input class="form-control form-control-xs" id="inputText3" type="text" name="name">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-12 col-sm-2 col-form-label text-sm-right" for="inputText3">父级栏目</label>
                            <div class="col-12 col-sm-6 col-lg-6">
                                <select class="form-control form-control-xs" name="pid">
                                    <option value="0">顶级栏目</option>
                                    @foreach($categories as $cateChild)
                                        <option value="{{ $cateChild['id'] }}">{!! $cateChild['_name'] !!}</option>
                                    @endforeach
                                </select>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-12 col-sm-2 col-form-label text-sm-right" for="inputText3"></label>
                            <div class="col-12 col-sm-6 col-lg-6">
                                <button class="btn btn-success">保存提交</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        @endslot
    @endcomponent
@endsection
@section('script')
    <script>
        function delRole(id,ct)
        {
            if(confirm("确认删除?")){
                $(ct).next('form').trigger('submit');
            }
        }
    </script>
@endsection

